<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BOM-doc</title>
    <script>
        //获取标题
        var title = document.title;
        console.log(title)

        function setColor() {
            //修改颜色
            document.bgColor = "pink";
            //修改前景颜色
            document.fgColor = "green";
            //获取请求的url
            document.url = "https://www.baidu.com/";
            console.log(document.url);

            //设置cookie
            document.cookie = "welcome stu py";
            console.log(document.cookie);
        }

        var str = "这是一句话";
        console.log(str)

        document.write("hello word");

        document.write("<h1>这是一个大标题</h1>");

        var charset = document.charset;
        console.log(charset);
    </script>
</head>
<body  onload="setColor()">
    <h1 id="i1">这是一个标题</h1>
</body>
</html>